local zunbei = fk.CreateSkill{
    name = "ym2__zunbei",
    tags = {Skill.Permanent},
}
Fk:loadTranslationTable{
    ["ym2__zunbei"] = "尊卑",
    [":ym2__zunbei"] = "持恒技，游戏开始时，令其他角色同时选择一张异性武将牌作为副将，且所有角色的副将技能均失效。场上每有一名女性角色，你摸牌阶段便多摸一张牌。",
}
zunbei:addEffect(fk.GameStart, {
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(zunbei.name)
    end,
    on_cost = Util.TrueFunc,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local generalNum = room.settings.generalNum
        local tos = room:getOtherPlayers(player)
        local req = Request:new(tos, "AskForGeneral")
        req.focus_text = zunbei.name
        local returnGenerals = {}
        for i, p in ipairs(tos) do
            local generals = room:findGenerals(function (g)
                if Fk.generals[g].gender == General.Bigender or Fk.generals[p.general].gender == General.Bigender then return true end
                return Fk.generals[g].gender ~= Fk.generals[p.general].gender
            end,generalNum)
            table.insertTableIfNeed(returnGenerals,generals)
            req:setData(p, { generals, 1 })
            req:setDefaultReply(p, table.random(generals, 1))
        end
        req:ask()

        for _, p in ipairs(tos) do
            local result = req:getResult(p)
            table.removeOne(returnGenerals,result[1])
            if p.deputyGeneral ~= "" then
                table.insertIfNeed(returnGenerals,p.deputyGeneral)
            end
            --room:prepareGeneral(p, p.general, result[1], true)
            room:changeHero(p,result[1],false,true,true,true,false)
        end
        room:returnToGeneralPile(returnGenerals)
    end,
})
zunbei:addEffect(fk.DrawNCards, {
    anim_type = "drawcard",
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(zunbei.name) and #table.filter(player.room.alive_players, function (p)
            return p:isFemale()
        end) > 0
    end,
    on_cost = Util.TrueFunc,
    on_use = function(self, event, target, player, data)
        data.n = data.n + #table.filter(player.room.alive_players, function (p)
            return p:isFemale()
        end)
    end,
})
zunbei:addEffect("invalidity",{
    invalidity_func = function(self, from, skill)
        if #table.filter(Fk:currentRoom().alive_players,function (cp)
            Fk:currentRoom():setBanner(zunbei.name,1)
            return cp:hasSkill(zunbei.name,true)
        end) > 0 then
            local deputy = from.deputyGeneral
            if Fk.generals[deputy] and table.contains(Fk.generals[deputy]:getSkillNameList(true),skill.name) and skill:isPlayerSkill(from) then
                return true
            end
        end
    end,
})
return zunbei